/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.util;

import java.util.Date;
import java.util.Random;

/**
 *
 * @author PhucAn
 */
public class GeneratorUtil {
    static String  characterMap="abcdefghiklmnopqrstuvwxyzABCDEFGHIKLMNOPQRSTUVXYWZ1234567890";
    
    public static String getRandomPassword(int length){
        int len=characterMap.length();
        int curLen=0;
        String pwd="";
        Random rnd=new Random(new Date().getTime());
        int curPos=0;
        while(curLen<length){
            curPos=rnd.nextInt(len);
            pwd+=characterMap.charAt(curPos);
            curLen++;
        }
        return pwd;
    }
   // public static void main(String[] args) {
    //    System.out.println(getRandomPassword(7));
    //}
}
